﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="index.aspx.cs" Inherits="Web.index" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style>
    body{ font-size:12px;}
    </style>
    <script language="javascript" type="text/jscript">
        function GetAllCheckBox(CheckAll) {

            var items = document.getElementsByTagName("input");
            for (i = 0; i < items.length; i++) {
                if (items[i].type == "checkbox") {
                    items[i].checked = CheckAll.checked;
                }
            }
        }
</script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
        <asp:Label ID="Label1" runat="server" Text="Search Role" Font-Bold="True"></asp:Label>
    
        <br />
        <br />
    
        <asp:Label ID="Label2" runat="server" Text="RoleName:"></asp:Label>
    
        <asp:TextBox ID="txtRolename" runat="server" Width="150"></asp:TextBox>
    
    &nbsp;&nbsp;&nbsp;
    
        <asp:Label ID="Label3" runat="server" Text="Status:"></asp:Label>
    
        <asp:DropDownList ID="DropDownList1" runat="server" Width="80" 
            DataTextField="StatusName" 
            DataValueField="StatusId" 
            onselectedindexchanged="DropDownList1_SelectedIndexChanged">
        </asp:DropDownList>
        
    
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:Button ID="btnSearch" runat="server" Text="Search" 
            onclick="btnSearch_Click" />
    
    </div><br />
    <br />
    
        <asp:Label ID="Label4" runat="server" Text="Role List" Font-Bold="True"></asp:Label>
    
        <br />
    <br />
        
        <asp:Button ID="btninuse" runat="server" Text="Batch Update(in use)" 
        onclick="btninuse_Click" />

        &nbsp;&nbsp;&nbsp;&nbsp;
        <asp:Button ID="btnnouse" runat="server" Text="Batch Update(no use)" 
        onclick="btnnouse_Click" />
    
    <br />
    
        <br />
    <div>
        <table border="1" cellspacing="0" cellpadding="0">
	<tr>
		<td width="50" height="25" align="center" valign="middle" bgcolor="#999999">select</td>
		<td width="80" align="center" valign="middle" bgcolor="#999999">Role Id</td>
		<td width="300" align="center" valign="middle" bgcolor="#999999">Role Name</td>
		<td width="150" align="center" valign="middle" bgcolor="#999999">Status</td>
		<td width="120" align="center" valign="middle" bgcolor="#999999">Tool</td>
	</tr>
    <asp:Repeater ID="rptlist" runat="server" OnItemCommand="Repeater1_ItemCommand" OnItemDataBound="Repeater1_ItemDataBound">
    <ItemTemplate>
	<tr>
		<td width="50" height="25" align="center" valign="middle">
        <asp:CheckBox ID="chks" runat="server" />
        <asp:HiddenField ID="HiddenField1" runat="server" Value='<%# Eval("RoleId") %>' />
        </td>
		<td width="80" align="center" valign="middle"><%# Eval("RoleId") %></td>
		<td width="300" align="center" valign="middle"><%# Eval("RoleName") %></td>
		<%--<td width="150" align="center" valign="middle"><%# Eval("StatusText.StatusName")%></td>--%>
        <td width="150" align="center" valign="middle"><%# Utility.Factory.StatusTextEF().GetById(Convert.ToInt32(Eval("StatusText.StatusId"))).StatusName %></td>
       
         
		<td width="120" align="center" valign="middle">
        <asp:Button ID="btndel" CommandName="del" CommandArgument='<%# Eval("RoleId") %>' runat="server" Text="Delete" />
    
        </td>
	</tr>
     </ItemTemplate>
    </asp:Repeater>
</table>
    </div>
    </form>
</body>
</html>
